I was trying to get the following Terraform to work:
resource "pagerduty_service" "example" {
name = "Example Service"
escalation_policy = pagerduty_escalation_policy.example.id
incident_urgency_rule {
type = "use_support_hours"
during_support_hours {
type = "constant"
urgency = "high"
}
outside_support_hours {
type = "constant"
urgency = "severity_based"
}
}
support_hours {
type = "fixed_time_per_day"
time_zone = "America/Los_Angeles"
days_of_week = [1,2,3,4,5]
start_time = "09:00:00"
end_time = "17:00:00"
}
scheduled_actions {
type = "urgency_change"
to_urgency = "high"
at {
type = "named_time"
name = "support_hours_start"
}
}
}
But I got a strange error message when running terraform apply
:
Error: PUT API call to https://api.pagerduty.com/services/P2A8DVT failed 400 Bad Request. Code: 2001, Errors: [Scheduled actions can only include upurgency at service hours start if urgency is high during service hours.], Message: Invalid Input Provided
on example.tf line 56, in resource “pagerduty_service” “example”:
56: resource “pagerduty_service” “example” {
I think this is strange because urgency is configured to be high during service hours.
If I configure the incident_rule
, like this I don’t get that error when I run terraform apply
:
incident_urgency_rule {
type = "use_support_hours"
during_support_hours {
type = "constant"
urgency = "severity_based"
}
outside_support_hours {
type = "constant"
urgency = "low"
}
}